package enterprises

import grails.test.*

class TypeOwnershipTests extends GrailsUnitTestCase {
	TypeOwnership typeOwnership
	
    protected void setUp() {
        super.setUp()
		typeOwnership = new TypeOwnership()
		mockForConstraintsTests(TypeOwnership, [typeOwnership])
    }

    protected void tearDown() {
        super.tearDown()
    }

	void testNullableName() {
		assertFalse(typeOwnership.validate())
		assertEquals "nullable", typeOwnership.errors["name"]
	}
	
	void testEmptyName() {
		typeOwnership.name = ""
		
		assertFalse(typeOwnership.validate())
		assertEquals "blank", typeOwnership.errors["name"]
	}
	
	void testSmallName() {
		typeOwnership.name = "as"
		
		assertFalse(typeOwnership.validate())
		assertEquals "minSize", typeOwnership.errors["name"]
	}
}
